<script setup lang="ts">
defineProps<{
  modelValue: number
  car: string
  house: string
}>()

const emit = defineEmits<{
  (e: 'update:modelValue', money: number): void
  (e: 'update:car', car: string): void
  (e: 'update:house', house: string): void
}>()
</script>

<template>
  <div class="child-page">
    <p>钱包: {{ modelValue }}</p>
    <button @click="emit('update:modelValue', modelValue + 25000)">
      搬砖一个月
    </button>
    <p>----------------------</p>
    <p>车: {{ car }}</p>
    <button @click="emit('update:car', '小电驴')">换车</button>
    <p>----------------------</p>
    <p>住处: {{ house }}</p>
    <button @click="emit('update:house', '乡村大別野')">搬砖2年换房</button>
  </div>
</template>

<style lang="scss" scoped></style>
